package com.mkh.st.common.core.constant.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

@Getter
@AllArgsConstructor
public enum BusinessTypeEnum {

	CANTEEN(1, "食堂"),
	SMALLB(2, "小B");

	/**
	 * 类型
	 */
	private Integer code;

	/**
	 * 描述
	 */
	private String description;

	public static BusinessTypeEnum get(Integer code){
		if (Objects.isNull(code)) {
			return null;
		}
		for (BusinessTypeEnum businessTypeEnum : BusinessTypeEnum.values()){
			if (code.equals(businessTypeEnum.code))  return businessTypeEnum;
		}
		return null;
	}
}
